<?php

namespace App\Http\Controllers\Api;

use App\Http\Resources\CustomerDemandCollection;
use App\model\CoustomerDemand;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class CustomerDemandController extends Controller
{
    public function index(Request $request){
        if ($request->input('type')==1){
            return collect(
                [
                [
                    'id'=>1,
                    'name'=>'三旧改造',

                ], [
                    'id'=>2,
                    'name'=>'园区规划',

                ],[
                    'id'=>3,
                    'name'=>'厂房代理',

                ]
                    ]
            );
        }else{
            $demand=CoustomerDemand::all();
        }


        return new CustomerDemandCollection($demand);
    }
}
